package com.itheima;

import java.util.Arrays;

public class 数组倒序 {

    public static void main(String[] args) {
        int[] arr = {11, 22, 33, 44, 55, 66};

        resverse(arr);

        System.out.println(Arrays.toString(arr));
    }

    private static void resverse(int[] arr) {
        int first = 0;
        int end = arr.length - 1;
        int temp = 0;

        while (first < end) {
            temp = arr[end];
            arr[end] = arr[first];
            arr[first] = temp;

            first++;
            end--;
        }
    }
}
